package com.csdj.t309springboot.service;
import com.csdj.t309springboot.entity.Topic;
import com.csdj.t309springboot.entity.TopicExample;
import com.csdj.t309springboot.mapper.TopicMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class TopicService {
    @Resource
    private TopicMapper mapper;

    public int insert(Topic topic) {
        return mapper.insert(topic);
    }

    public List<Topic> topiclist() {
        return mapper.selectByExample(new TopicExample());
    }
    public List<Topic> topicAllList(Integer id) {
        TopicExample topicExample;
        topicExample=new TopicExample();
        topicExample.createCriteria().andIdEqualTo(id);

        List<Topic> list=mapper.selectByExampledetaiils(topicExample);

        return list;
    }


}
